package org.example.fortest.repository;

import org.example.fortest.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface UserRepository extends JpaRepository<User, Long> {


    @Modifying
    @Transactional
    @Query("UPDATE User u SET u.delFlag = 2 WHERE u.id = :id")
    void deleteByFlag(Long id);
}
